The idea is to make use of WebWork's theme and templating to style the button's position as one wish. For example to have the submit button besides a text field, one could do the followings

Method one

Using simple theme, which doesn't enforce a certain layout pattern like certain themes such as xhtml (using tables) and css_xhtml (using divs and spans) does.

Apply the simple theme by adding theme="simple" in the tags for the components. The following examples are in Freemarker, adjust as necessary for jsp:

<@ww.textfield name="foo" theme="simple"/>
<@ww.submit theme="simple"/>

or alternatively,

<@ww.form ... theme="simple"/>
    <@ww.textfield name="foo" />
    <@ww.submit />
</@ww.form>

Method two

An alternate approach would be to use the 'after' parameter that's available in most WebWork tags. An example using Freemarker would be as follows, adjust as necessary for jsp:

<@ww.textfield name="foo" theme="xhtml">
    <@ww.param name="after">
        <@ww.submit theme="simple"/>
    </@ww.param>
</@ww.textfield>

This will render the submit button within the same table column as the text field (since xhtml styled components using HTML table.

Relevant information

p/s: Special thanks to Lens and Philip Luppens for the information.